<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>消息</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../css/mui.css">
		<style type="text/css">
			.mui-ellipsis {
				width: 80%;
			}

			.mui-media-body span:last-child {
				position: absolute;
				right: 1.5em;
				bottom: 1.2em;
			}

			.mui-media-body span:first-child {
				font-size: 0.8em;
				color: #999999;
			}

			.mui-table-view-cell img {
				border-radius: 1.2em;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a data-type="showtool" onclick="openWin()" class="mui-icon mui-icon-plusempty mui-pull-right"></a>
			<img id="touxiang" class="mui-pull-left" src=""/>
			<h1 class="mui-title">消息</h1>
		</header>
		<div class="heard1">
			<div class="mui-input-row mui-search">
				<input type="search" class="mui-input-clear" placeholder="" disabled="disabled" data-input-clear="1"
				 data-input-search="1">
				<span class="mui-placeholder"><span class="mui-icon mui-icon-search">
					</span><span>搜索</span></span>
			</div>
		</div>
		<ul class="mui-table-view">
			<li class="mui-table-view-cell mui-media">
				<div class="mui-slider-right mui-disabled">
					<a class="mui-btn mui-btn-grey">置顶</a>
					<a class="mui-btn mui-btn-yellow">标为已读</a>
					<a class="mui-btn mui-btn-red">移除</a>
				</div>
				<a class="mui-slider-handle" href="javascript:;" data-userid = "999">
					<img class="mui-media-object mui-pull-left" src="../images/icon2.png">
					<div class="mui-media-body">
						5+app
						<span class="mui-pull-right">24:56</span>
						<p class="mui-ellipsis">HTML5 Plus移动App，简称5+App</p>
						<span class="mui-badge mui-badge mui-pull-right">1</span>
					</div>
				</a>
			</li>
			<li class="mui-table-view-cell mui-media">
				<div class="mui-slider-right mui-disabled">
					<a class="mui-btn mui-btn-grey">置顶</a>
					<a class="mui-btn mui-btn-yellow">标为已读</a>
					<a class="mui-btn mui-btn-red">移除</a>
				</div>
				<a class="mui-slider-handle" href="javascript:;" data-userid = "888">
					<img class="mui-media-object mui-pull-left" src="../images/uni.png">
					<div class="mui-media-body">
						nui-app
						<span class="mui-pull-right">24:56</span>
						<p class="mui-ellipsis">uni-app 是一个使用 Vue.js 开发跨平台应用的前端框架</p>
						<span class="mui-badge mui-badge mui-pull-right">2</span>
					</div>
				</a>
			</li>
		</ul>

	</body>
	
	<script src="../js/mui.min.js"></script>
	<script src="../js/myapp.js"></script>
	<script type="text/javascript">
		mui.init();
		var pmenu;
		var self;
		mui.plusReady(function() {
			curuserinfo=getSettings();
			var touxiang = document.getElementById("touxiang");
			touxiang.setAttribute("src",baseutl+curuserinfo.picSm);
			self = plus.webview.currentWebview();
			setTimeout(function() {
				pmenu = plus.webview.getWebviewById("drag-left-menu");
				window.addEventListener("swiperight", openmenu);
				window.addEventListener("swipeleft", closemenu);
			}, 500);
			self.interceptTouchEvent(true);
		});
		window.addEventListener('dragright', function(e) {
			e.detail.gesture.preventDefault();
		});
		window.addEventListener('dragleft', function(e) {
			e.detail.gesture.preventDefault();
		});
		//打开左侧菜单
		function openmenu() {
			pmenu.show('slide-in-left', 200);
			setTimeout(function() {
				pmenu.evalJS("$('body>div:first').addClass('fullmsk')");
			}, 50);

		}
		//关闭左侧菜单
		function closemenu() {
			pmenu.hide('slide-out-left', '300');
		}

		mui('header').on('tap', 'img', function(e) {
			openmenu();
		});
		
		mui("li").on('tap','.mui-slider-handle',function(){
			console.log(this.getAttribute("data-userid"));
			mui.openWindow({
				url:"linkman/im-chat.html",
				id:"im-chat.html",
				show:{
				  autoShow:true,  //页面loaded事件发生后自动显示，默认为true
				  aniShow:"zoom-fade-out"
				},
				waiting:{
					autoShow:false //取消等待动画
				},
				extras:{
					userid:this.getAttribute("data-userid")  //扩展参数
				}
			})
		});

		function openWin() {
			var toolmenuWin = plus.webview.getWebviewById("tools_index");
			//console.log(toolmenuWin);
			if (toolmenuWin == null) {
				toolmenuWin = plus.webview.create('popover/tools_index.html', 'tools_index', {
					background: 'transparent',
					zindex: 99
				});
			};
			toolmenuWin.show();
		}
	</script>
</html>
